import axios from 'axios'

// 客户API
export default {
  // 获取所有客户
  getAllCustomers() {
    return axios.get('/customers')
  },
  
  // 获取客户详情
  getCustomer(id) {
    return axios.get(`/customers/${id}`)
  },
  
  // 根据邮箱获取客户
  getCustomerByEmail(email) {
    return axios.get(`/customers/email?email=${email}`)
  },
  
  // 搜索客户
  searchCustomers(name) {
    return axios.get(`/customers/search?name=${name}`)
  },
  
  // 添加客户
  addCustomer(customer) {
    return axios.post('/customers', customer)
  },
  
  // 更新客户
  updateCustomer(id, customer) {
    return axios.put(`/customers/${id}`, customer)
  },
  
  // 删除客户
  deleteCustomer(id) {
    return axios.delete(`/customers/${id}`)
  }
} 